package com.wwj.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component //组件,注入bean
// 相当于配置文件中 <bean id="user" class="当前注解的类"/>
public class User {
    //相当于<property name="name" value="wwj">
    @Value("wwj")  //注入属性
    public String name;
}
